﻿<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org>
<head>
<meta charset=" UTF-8/>
<title>菜菜烩旺堡</title>
<base th:href="${#request.getContextPath()}+'/'">
<link rel="icon" th:href="@{images/logo2.png}" type="image/ico">
<link rel="stylesheet" th:href="@{css/font-awesome-4.7.0/css/font-awesome.min.css}">
<link rel="stylesheet" th:href="@{css/login.css}">
</head>
<body>

<div class="materialContainer">
	<form class="box" action="dologin" method="post">
		<div class="title">登录</div>
			<div class="input">
				<p style="color: red" text="msg" if="not #strings.isEmpty(msg)"></p>
				<label for="name"></label>
				<input type="text" name="telephoneNumber" id="name" required lay-verify="required" th:placeholder="手机号">
				<span class="spin"></span>
			</div>
			<div class="input">
				<label for="pass"></label>
				<input type="password" name="password" id="pass" required lay-verify="required" th:placeholder="密码">
				<span class="spin"></span>
			</div>
			<div class="button login">
				<button>
					<span>登录</span>
					<i class="fa fa-check" type="submit"></i>
				</button>
			</div>
			<a href="javascript:" class="pass-forgot">忘记密码？</a>
	</form>
	<div class="overbox">
		<div class="material-button alt-2">
			<span class="shape"></span>
		</div>
		<div class="title">注册</div>
		<form action="doregister" method="post">
			<div class="input">
				<label for="regname"></label>
				<input type="text" name="telephoneNumber" id="regname" required lay-verify="required" autocomplete="off" placeholder="请输入用户名"><br>
				<span class="spin"></span>
			</div>
			<div class="input">
				<label for="regpass"></label>
				<input type="password" name="password" id="regpass" required lay-verify="required" autocomplete="off" placeholder="请输入密码"><br>
				<span class="spin"></span>
			</div>
			<div class="input">
				<label for="reregpass"></label>
				<input type="password" name="password1" id="reregpass" required lay-verify="required" autocomplete="off" placeholder="请再次确认密码"><br>
				<span class="spin"></span>
			</div>
			<span id="mas"></span>
			<div class="button">
				<button>
					<button onclick="gisterpass()" >注册</button>
				</button>
			</div>
		</form>
	</div>
</div>

<script th:src="@{js/login.jquery.min.js}"></script>
<script th:src="@{js/login.js}"></script>
<!--判断密码是否一直-->
<script>
	function gisterpass(){
		let regname = $("#regname").val();
		let regpass = $("#regpass").val();
		let reregpass = $("#reregpass").val();
		if (regpass == reregpass){
			$.post("/doregister",{
				'telephoneNumber':regname,
				'password':regpass,
			},function (response){
				console.log(response);
			})
		}else {
			alert("密码不一致");
		}
	}
</script>

</body>
</html>